import requests

from config.config import REGISTER_URL, DEFAULT_HEADERS


class RegisterApi(object):
    @classmethod
    def register(self, req_data):
        resp = requests.post(url=REGISTER_URL,
                            json=req_data,
                            headers=DEFAULT_HEADERS)
        return resp


if __name__ == '__main__':
    data = {"username": "1234", "password": "567891", "confirm": "567891"}
    resp = RegisterApi.register(data)
    print("注册成功", resp.json())